package com.xxgc.wujiaosocket.controller;

import org.springframework.messaging.handler.annotation.MessageMapping;
import org.springframework.messaging.handler.annotation.SendTo;
import org.springframework.stereotype.Controller;

@Controller
public class MessageController {
    @MessageMapping("/chat")
    @SendTo("/wujiao/chat")
    public String handleMessage(String message) {
        // 处理客户端发送到 /app/chat 的消息，并将消息广播到 /topic/chat 主题
        return message;
    }
}
